home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Comm / www / tidy_os4.lha / tidy / src / message.h < prev    next >
C/C++ Source or Header  |  2004-07-25  |  7KB  |  218 lines

  1. #ifndef __MESSAGE_H__
  2. #define __MESSAGE_H__
  3.  
  4. /* message.h -- general message writing routines
  5.  
  6.   (c) 1998-2004 (W3C) MIT, ERCIM, Keio University
  7.   See tidy.h for the copyright notice.
  8.   
  9.   CVS Info :
  10.  
  11.     $Author: terry_teague $ 
  12.     $Date: 2004/03/19 03:04:47 $ 
  13.     $Revision: 1.21 $ 
  14.  
  15. */
  16.  
  17. #include "forward.h"
  18. #include "tidy.h"  /* For TidyReportLevel */
  19.  
  20. /* General message writing routines.
  21. ** Each message is a single warning, error, etc.
  22. **
  23. ** This routine will keep track of counts and,
  24. ** if the caller has set a filter, it will be
  25. ** called.  The new preferred way of handling
  26. ** Tidy diagnostics output is either a) define
  27. ** a new output sink or b) install a message
  28. ** filter routine.
  29. **
  30. ** Keeps track of ShowWarnings, ShowErrors, etc.
  31. */
  32.  
  33. ctmbstr ReleaseDate(void);
  34.  
  35. /* Reports error at current Lexer line/column. */ 
  36. void message( TidyDocImpl* doc, TidyReportLevel level, ctmbstr msg, ... );
  37.  
  38. /* Reports error at node line/column. */ 
  39. void messageNode( TidyDocImpl* doc, TidyReportLevel level,
  40.                   Node* node, ctmbstr msg, ... );
  41.  
  42. /* Reports error at given line/column. */ 
  43. void messageLexer( TidyDocImpl* doc, TidyReportLevel level, 
  44.                    ctmbstr msg, ... );
  45.  
  46. /* For general reporting.  Emits nothing if --quiet yes */
  47. void tidy_out( TidyDocImpl* doc, ctmbstr msg, ... );
  48.  
  49.  
  50. void ShowVersion( TidyDocImpl* doc );
  51. void ReportUnknownOption( TidyDocImpl* doc, ctmbstr option );
  52. void ReportBadArgument( TidyDocImpl* doc, ctmbstr option );
  53. void NeedsAuthorIntervention( TidyDocImpl* doc );
  54.  
  55. void HelloMessage( TidyDocImpl* doc, ctmbstr date, ctmbstr filename );
  56. void ReportMarkupVersion( TidyDocImpl* doc );
  57. void ReportNumWarnings( TidyDocImpl* doc );
  58.  
  59. void GeneralInfo( TidyDocImpl* doc );
  60. void UnknownOption( TidyDocImpl* doc, char c );
  61. void UnknownFile( TidyDocImpl* doc, ctmbstr program, ctmbstr file );
  62. void FileError( TidyDocImpl* doc, ctmbstr file, TidyReportLevel level );
  63.  
  64. void ErrorSummary( TidyDocImpl* doc );
  65.  
  66. void ReportEncodingWarning(TidyDocImpl* doc, uint code, uint encoding);
  67. void ReportEncodingError(TidyDocImpl* doc, uint code, uint c, Bool discarded);
  68. void ReportEntityError( TidyDocImpl* doc, uint code, ctmbstr entity, int c );
  69. void ReportAttrError( TidyDocImpl* doc, Node* node, AttVal* av, uint code );
  70. void ReportMissingAttr( TidyDocImpl* doc, Node* node, ctmbstr name );
  71.  
  72. #if SUPPORT_ACCESSIBILITY_CHECKS
  73.  
  74. void ReportAccessWarning( TidyDocImpl* doc, Node* node, uint code );
  75. void ReportAccessError( TidyDocImpl* doc, Node* node, uint code );
  76.  
  77. #endif
  78.  
  79. void ReportNotice(TidyDocImpl* doc, Node *element, Node *node, uint code);
  80. void ReportWarning(TidyDocImpl* doc, Node *element, Node *node, uint code);
  81. void ReportError(TidyDocImpl* doc, Node* element, Node* node, uint code);
  82. void ReportFatal(TidyDocImpl* doc, Node* element, Node* node, uint code);
  83.  
  84. /* error codes for entities/numeric character references */
  85.  
  86. #define MISSING_SEMICOLON            1
  87. #define MISSING_SEMICOLON_NCR        2
  88. #define UNKNOWN_ENTITY               3
  89. #define UNESCAPED_AMPERSAND          4
  90. #define APOS_UNDEFINED               5
  91.  
  92. /* error codes for element messages */
  93.  
  94. #define MISSING_ENDTAG_FOR           6
  95. #define MISSING_ENDTAG_BEFORE        7
  96. #define DISCARDING_UNEXPECTED        8
  97. #define NESTED_EMPHASIS              9
  98. #define NON_MATCHING_ENDTAG          10
  99. #define TAG_NOT_ALLOWED_IN           11
  100. #define MISSING_STARTTAG             12
  101. #define UNEXPECTED_ENDTAG            13
  102. #define USING_BR_INPLACE_OF          14
  103. #define INSERTING_TAG                15
  104. #define SUSPECTED_MISSING_QUOTE      16
  105. #define MISSING_TITLE_ELEMENT        17
  106. #define DUPLICATE_FRAMESET           18
  107. #define CANT_BE_NESTED               19
  108. #define OBSOLETE_ELEMENT             20
  109. #define PROPRIETARY_ELEMENT          21
  110. #define UNKNOWN_ELEMENT              22
  111. #define TRIM_EMPTY_ELEMENT           23
  112. #define COERCE_TO_ENDTAG             24
  113. #define ILLEGAL_NESTING              25
  114. #define NOFRAMES_CONTENT             26
  115. #define CONTENT_AFTER_BODY           27
  116. #define INCONSISTENT_VERSION         28
  117. #define MALFORMED_COMMENT            29
  118. #define BAD_COMMENT_CHARS            30
  119. #define BAD_XML_COMMENT              31
  120. #define BAD_CDATA_CONTENT            32
  121. #define INCONSISTENT_NAMESPACE       33
  122. #define DOCTYPE_AFTER_TAGS           34
  123. #define MALFORMED_DOCTYPE            35
  124. #define UNEXPECTED_END_OF_FILE       36
  125. #define DTYPE_NOT_UPPER_CASE         37
  126. #define TOO_MANY_ELEMENTS            38
  127. #define UNESCAPED_ELEMENT            39
  128. #define NESTED_QUOTATION             40
  129. #define ELEMENT_NOT_EMPTY            41
  130. #define ENCODING_IO_CONFLICT         42
  131. #define MIXED_CONTENT_IN_BLOCK       43
  132. #define MISSING_DOCTYPE              44
  133. #define SPACE_PRECEDING_XMLDECL      45
  134. #define TOO_MANY_ELEMENTS_IN         46
  135. #define UNEXPECTED_ENDTAG_IN         47
  136. #define REPLACING_ELEMENT            83
  137. #define REPLACING_UNEX_ELEMENT       84
  138. #define COERCE_TO_ENDTAG_WARN        85 /* last */
  139.  
  140. /* error codes used for attribute messages */
  141.  
  142. #define UNKNOWN_ATTRIBUTE            48
  143. #define INSERTING_ATTRIBUTE          49
  144. #define MISSING_ATTR_VALUE           50
  145. #define BAD_ATTRIBUTE_VALUE          51
  146. #define UNEXPECTED_GT                52
  147. #define PROPRIETARY_ATTRIBUTE        53
  148. #define PROPRIETARY_ATTR_VALUE       54
  149. #define REPEATED_ATTRIBUTE           55
  150. #define MISSING_IMAGEMAP             56
  151. #define XML_ATTRIBUTE_VALUE          57
  152. #define UNEXPECTED_QUOTEMARK         58
  153. #define MISSING_QUOTEMARK            59
  154. #define ID_NAME_MISMATCH             60
  155.  
  156. #define BACKSLASH_IN_URI             61
  157. #define FIXED_BACKSLASH              62
  158. #define ILLEGAL_URI_REFERENCE        63
  159. #define ESCAPED_ILLEGAL_URI          64
  160.  
  161. #define NEWLINE_IN_URI               65
  162. #define ANCHOR_NOT_UNIQUE            66
  163.  
  164. #define JOINING_ATTRIBUTE            68
  165. #define UNEXPECTED_EQUALSIGN         69
  166. #define ATTR_VALUE_NOT_LCASE         70
  167. #define XML_ID_SYNTAX                71
  168.  
  169. #define INVALID_ATTRIBUTE            72
  170.  
  171. #define BAD_ATTRIBUTE_VALUE_REPLACED 73
  172.  
  173. #define INVALID_XML_ID               74
  174. #define UNEXPECTED_END_OF_FILE_ATTR  75
  175.  
  176.  
  177. /* character encoding errors */
  178.  
  179. #define VENDOR_SPECIFIC_CHARS        76
  180. #define INVALID_SGML_CHARS           77
  181. #define INVALID_UTF8                 78
  182. #define INVALID_UTF16                79
  183. #define ENCODING_MISMATCH            80
  184. #define INVALID_URI                  81
  185. #define INVALID_NCR                  82
  186.  
  187. /* accessibility flaws */
  188.  
  189. #define MISSING_IMAGE_ALT       1
  190. #define MISSING_LINK_ALT        2
  191. #define MISSING_SUMMARY         4
  192. #define MISSING_IMAGE_MAP       8
  193. #define USING_FRAMES            16
  194. #define USING_NOFRAMES          32
  195.  
  196. /* presentation flaws */
  197.  
  198. #define USING_SPACER            1
  199. #define USING_LAYER             2
  200. #define USING_NOBR              4
  201. #define USING_FONT              8
  202. #define USING_BODY              16
  203.  
  204. #define REPLACED_CHAR           0
  205. #define DISCARDED_CHAR          1
  206.  
  207. /* badchar bit field */
  208.  
  209. #define BC_VENDOR_SPECIFIC_CHARS   1
  210. #define BC_INVALID_SGML_CHARS      2
  211. #define BC_INVALID_UTF8            4
  212. #define BC_INVALID_UTF16           8
  213. #define BC_ENCODING_MISMATCH       16 /* fatal error */
  214. #define BC_INVALID_URI             32
  215. #define BC_INVALID_NCR             64
  216.  
  217. #endif /* __MESSAGE_H__ */
  218.